<?php 
require_once 'models/models_mathang.php';
require_once 'models/models_chungloai.php';
$obcl=new models_chungloai();
$obmh = new models_mathang();
require_once 'models/models_loaihang.php';
$oblh=new models_loaihang();

?>
<div id="sanpham_right">
	<div id="title_right">
		<p id="title_right_left"></p>
		<div id="title_right_center">
			<p class="chu_title">SẢN PHẨM TRẺ EM</p>
		</div>
		<p id="title_right_right"></p>
	</div>
	<div id="noidung_right">
	<?php 
	$clte=$obcl->listchungloaite();
	//var_dump($clte['MaCL']);
	$data['listmh']=$obmh->listMatHang();
	$i=0;
	if(isset($clte))
	{
		$data['listlh']=$oblh->_getloaihang($clte['MaCL']);
		//var_dump($data['listlh']);
		if(is_array($data['listlh']))
		{
			foreach ($data['listlh'] as $lh)
			{
				
				if(is_array($data['listmh']))
				{
					foreach ($data['listmh'] as $mh)
					{
						if($lh['MaLH']==$mh['MaLH']){
							//var_dump($mh);
							if($i<3)
				{	
					
				
			?>
	
		<div id="sanpham">
			<p align="center">
				
					<a href="public/upload/<?php echo $mh['HinhAnh'];?>" class="MagicZoomPlus" rel="zoom-position: right; zoom-height: 300px;"><img
					src="public/upload/<?php echo $mh['HinhAnh'];?>" width="100px" /></a>
				
			</p>
			<p class="ten_sp">
				<a href="index.php?mod=detail&id=<?php echo $mh['MaMH'];?>"><?php echo $mh['TenMH'];?>
				</a>
			</p>
			<p class="gia_sp">
			<?php echo number_format($mh['Gia']);?>
				VNĐ
			</p>
			<a href="index.php?mod=dathang&id=<?php echo $mh['MaMH'];?>&tenmh=<?php echo $mh['TenMH'];?>&gia=<?php echo $mh['Gia'];?>">
			<img src="public/hinhanh/mua1.jpg" style="margin-left: 30px;margin-bottom: 10px" ></a>
			<a href="index.php?mod=detail&id=<?php echo $mh['MaMH'];?>">
			<img src="public/hinhanh/xem1.jpg" align="middle" style="margin-right: 10px;margin-bottom: 10px"></a>
		</div>

		<?php
		$i++;
						}
					}
				}
				}
			}
		}

	}?>
	<br>
	<p align="right"><a href="index.php?mod=sanphamtreem" style="color: red"><img src="public/hinhanh/xem them.jpg"></a></p>
	</div>
	</div>